#include "AppDelegate.h"
#include "StartScene.h"
#include "MainScene.h"
#include "../GameLogic/GameManager.h"
#include "GlobalPrec.h"


void LoadGameLayer::OnRegistLayer()
{
	RegistLayer<StartLayer>("page_start");
}
void LoadGameLayer::OnLoadLayerFile()
{
	LoadFile("pages.lua");
}

void LoadScene::OnRegister()
{
	RegistScene<MainScene>("scene_main");
	RegistScene<StartScene>("scene_start");
}



void AppDelegate::OnDidFinishLaunching() 
{
	GameManager::StaticInit();
	
	LoadGameLayer loadlayer;
	GameLayerConfigMgr::Instance()->Init(new LoadFileLua::GameLayerConfigFileLoaderLua(),loadlayer);
	LoadScene loadscene;
	GameSceneMgr::Instance()->Init(loadscene);

	GameSceneMgr::Instance()->RunScene("scene_start");
}
